/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package BoardGame.impl;

import BoardGame.Board;
import BoardGame.BoardGamePackage;
import BoardGame.Field;
import BoardGame.Figure;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

import org.eclipse.emf.ecore.util.EcoreUtil;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Field</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link BoardGame.impl.FieldImpl#getBoard <em>Board</em>}</li>
 *   <li>{@link BoardGame.impl.FieldImpl#getNeighbourNorth <em>Neighbour North</em>}</li>
 *   <li>{@link BoardGame.impl.FieldImpl#getNeighbourSouth <em>Neighbour South</em>}</li>
 *   <li>{@link BoardGame.impl.FieldImpl#getNeighbourEast <em>Neighbour East</em>}</li>
 *   <li>{@link BoardGame.impl.FieldImpl#getNeighbourWest <em>Neighbour West</em>}</li>
 *   <li>{@link BoardGame.impl.FieldImpl#getFigure <em>Figure</em>}</li>
 *   <li>{@link BoardGame.impl.FieldImpl#getX <em>X</em>}</li>
 *   <li>{@link BoardGame.impl.FieldImpl#getY <em>Y</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class FieldImpl extends EObjectImpl implements Field {
	/**
	 * The cached value of the '{@link #getNeighbourNorth() <em>Neighbour North</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getNeighbourNorth()
	 * @generated
	 * @ordered
	 */
	protected Field neighbourNorth;

	/**
	 * The cached value of the '{@link #getNeighbourSouth() <em>Neighbour South</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getNeighbourSouth()
	 * @generated
	 * @ordered
	 */
	protected Field neighbourSouth;

	/**
	 * The cached value of the '{@link #getNeighbourEast() <em>Neighbour East</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getNeighbourEast()
	 * @generated
	 * @ordered
	 */
	protected Field neighbourEast;

	/**
	 * The cached value of the '{@link #getNeighbourWest() <em>Neighbour West</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getNeighbourWest()
	 * @generated
	 * @ordered
	 */
	protected Field neighbourWest;

	/**
	 * The cached value of the '{@link #getFigure() <em>Figure</em>}' containment reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getFigure()
	 * @generated
	 * @ordered
	 */
	protected Figure figure;

	/**
	 * The default value of the '{@link #getX() <em>X</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getX()
	 * @generated
	 * @ordered
	 */
	protected static final int X_EDEFAULT = 0;

	/**
	 * The cached value of the '{@link #getX() <em>X</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getX()
	 * @generated
	 * @ordered
	 */
	protected int x = X_EDEFAULT;

	/**
	 * The default value of the '{@link #getY() <em>Y</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getY()
	 * @generated
	 * @ordered
	 */
	protected static final int Y_EDEFAULT = 0;

	/**
	 * The cached value of the '{@link #getY() <em>Y</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getY()
	 * @generated
	 * @ordered
	 */
	protected int y = Y_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected FieldImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return BoardGamePackage.Literals.FIELD;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Board getBoard() {
		if (eContainerFeatureID() != BoardGamePackage.FIELD__BOARD)
			return null;
		return (Board) eContainer();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetBoard(Board newBoard,
			NotificationChain msgs) {
		msgs = eBasicSetContainer((InternalEObject) newBoard,
				BoardGamePackage.FIELD__BOARD, msgs);
		return msgs;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setBoard(Board newBoard) {
		if (newBoard != eInternalContainer()
				|| (eContainerFeatureID() != BoardGamePackage.FIELD__BOARD && newBoard != null)) {
			if (EcoreUtil.isAncestor(this, newBoard))
				throw new IllegalArgumentException(
						"Recursive containment not allowed for " + toString());
			NotificationChain msgs = null;
			if (eInternalContainer() != null)
				msgs = eBasicRemoveFromContainer(msgs);
			if (newBoard != null)
				msgs = ((InternalEObject) newBoard).eInverseAdd(this,
						BoardGamePackage.BOARD__FIELDS, Board.class, msgs);
			msgs = basicSetBoard(newBoard, msgs);
			if (msgs != null)
				msgs.dispatch();
		} else if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET,
					BoardGamePackage.FIELD__BOARD, newBoard, newBoard));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Field getNeighbourNorth() {
		if (neighbourNorth != null && neighbourNorth.eIsProxy()) {
			InternalEObject oldNeighbourNorth = (InternalEObject) neighbourNorth;
			neighbourNorth = (Field) eResolveProxy(oldNeighbourNorth);
			if (neighbourNorth != oldNeighbourNorth) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE,
							BoardGamePackage.FIELD__NEIGHBOUR_NORTH,
							oldNeighbourNorth, neighbourNorth));
			}
		}
		return neighbourNorth;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Field basicGetNeighbourNorth() {
		return neighbourNorth;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetNeighbourNorth(Field newNeighbourNorth,
			NotificationChain msgs) {
		Field oldNeighbourNorth = neighbourNorth;
		neighbourNorth = newNeighbourNorth;
		if (eNotificationRequired()) {
			ENotificationImpl notification = new ENotificationImpl(this,
					Notification.SET, BoardGamePackage.FIELD__NEIGHBOUR_NORTH,
					oldNeighbourNorth, newNeighbourNorth);
			if (msgs == null)
				msgs = notification;
			else
				msgs.add(notification);
		}
		return msgs;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setNeighbourNorth(Field newNeighbourNorth) {
		if (newNeighbourNorth != neighbourNorth) {
			NotificationChain msgs = null;
			if (neighbourNorth != null)
				msgs = ((InternalEObject) neighbourNorth).eInverseRemove(this,
						BoardGamePackage.FIELD__NEIGHBOUR_SOUTH, Field.class,
						msgs);
			if (newNeighbourNorth != null)
				msgs = ((InternalEObject) newNeighbourNorth).eInverseAdd(this,
						BoardGamePackage.FIELD__NEIGHBOUR_SOUTH, Field.class,
						msgs);
			msgs = basicSetNeighbourNorth(newNeighbourNorth, msgs);
			if (msgs != null)
				msgs.dispatch();
		} else if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET,
					BoardGamePackage.FIELD__NEIGHBOUR_NORTH, newNeighbourNorth,
					newNeighbourNorth));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Field getNeighbourSouth() {
		if (neighbourSouth != null && neighbourSouth.eIsProxy()) {
			InternalEObject oldNeighbourSouth = (InternalEObject) neighbourSouth;
			neighbourSouth = (Field) eResolveProxy(oldNeighbourSouth);
			if (neighbourSouth != oldNeighbourSouth) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE,
							BoardGamePackage.FIELD__NEIGHBOUR_SOUTH,
							oldNeighbourSouth, neighbourSouth));
			}
		}
		return neighbourSouth;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Field basicGetNeighbourSouth() {
		return neighbourSouth;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetNeighbourSouth(Field newNeighbourSouth,
			NotificationChain msgs) {
		Field oldNeighbourSouth = neighbourSouth;
		neighbourSouth = newNeighbourSouth;
		if (eNotificationRequired()) {
			ENotificationImpl notification = new ENotificationImpl(this,
					Notification.SET, BoardGamePackage.FIELD__NEIGHBOUR_SOUTH,
					oldNeighbourSouth, newNeighbourSouth);
			if (msgs == null)
				msgs = notification;
			else
				msgs.add(notification);
		}
		return msgs;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setNeighbourSouth(Field newNeighbourSouth) {
		if (newNeighbourSouth != neighbourSouth) {
			NotificationChain msgs = null;
			if (neighbourSouth != null)
				msgs = ((InternalEObject) neighbourSouth).eInverseRemove(this,
						BoardGamePackage.FIELD__NEIGHBOUR_NORTH, Field.class,
						msgs);
			if (newNeighbourSouth != null)
				msgs = ((InternalEObject) newNeighbourSouth).eInverseAdd(this,
						BoardGamePackage.FIELD__NEIGHBOUR_NORTH, Field.class,
						msgs);
			msgs = basicSetNeighbourSouth(newNeighbourSouth, msgs);
			if (msgs != null)
				msgs.dispatch();
		} else if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET,
					BoardGamePackage.FIELD__NEIGHBOUR_SOUTH, newNeighbourSouth,
					newNeighbourSouth));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Field getNeighbourEast() {
		if (neighbourEast != null && neighbourEast.eIsProxy()) {
			InternalEObject oldNeighbourEast = (InternalEObject) neighbourEast;
			neighbourEast = (Field) eResolveProxy(oldNeighbourEast);
			if (neighbourEast != oldNeighbourEast) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE,
							BoardGamePackage.FIELD__NEIGHBOUR_EAST,
							oldNeighbourEast, neighbourEast));
			}
		}
		return neighbourEast;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Field basicGetNeighbourEast() {
		return neighbourEast;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetNeighbourEast(Field newNeighbourEast,
			NotificationChain msgs) {
		Field oldNeighbourEast = neighbourEast;
		neighbourEast = newNeighbourEast;
		if (eNotificationRequired()) {
			ENotificationImpl notification = new ENotificationImpl(this,
					Notification.SET, BoardGamePackage.FIELD__NEIGHBOUR_EAST,
					oldNeighbourEast, newNeighbourEast);
			if (msgs == null)
				msgs = notification;
			else
				msgs.add(notification);
		}
		return msgs;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setNeighbourEast(Field newNeighbourEast) {
		if (newNeighbourEast != neighbourEast) {
			NotificationChain msgs = null;
			if (neighbourEast != null)
				msgs = ((InternalEObject) neighbourEast).eInverseRemove(this,
						BoardGamePackage.FIELD__NEIGHBOUR_WEST, Field.class,
						msgs);
			if (newNeighbourEast != null)
				msgs = ((InternalEObject) newNeighbourEast).eInverseAdd(this,
						BoardGamePackage.FIELD__NEIGHBOUR_WEST, Field.class,
						msgs);
			msgs = basicSetNeighbourEast(newNeighbourEast, msgs);
			if (msgs != null)
				msgs.dispatch();
		} else if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET,
					BoardGamePackage.FIELD__NEIGHBOUR_EAST, newNeighbourEast,
					newNeighbourEast));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Field getNeighbourWest() {
		if (neighbourWest != null && neighbourWest.eIsProxy()) {
			InternalEObject oldNeighbourWest = (InternalEObject) neighbourWest;
			neighbourWest = (Field) eResolveProxy(oldNeighbourWest);
			if (neighbourWest != oldNeighbourWest) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE,
							BoardGamePackage.FIELD__NEIGHBOUR_WEST,
							oldNeighbourWest, neighbourWest));
			}
		}
		return neighbourWest;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Field basicGetNeighbourWest() {
		return neighbourWest;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetNeighbourWest(Field newNeighbourWest,
			NotificationChain msgs) {
		Field oldNeighbourWest = neighbourWest;
		neighbourWest = newNeighbourWest;
		if (eNotificationRequired()) {
			ENotificationImpl notification = new ENotificationImpl(this,
					Notification.SET, BoardGamePackage.FIELD__NEIGHBOUR_WEST,
					oldNeighbourWest, newNeighbourWest);
			if (msgs == null)
				msgs = notification;
			else
				msgs.add(notification);
		}
		return msgs;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setNeighbourWest(Field newNeighbourWest) {
		if (newNeighbourWest != neighbourWest) {
			NotificationChain msgs = null;
			if (neighbourWest != null)
				msgs = ((InternalEObject) neighbourWest).eInverseRemove(this,
						BoardGamePackage.FIELD__NEIGHBOUR_EAST, Field.class,
						msgs);
			if (newNeighbourWest != null)
				msgs = ((InternalEObject) newNeighbourWest).eInverseAdd(this,
						BoardGamePackage.FIELD__NEIGHBOUR_EAST, Field.class,
						msgs);
			msgs = basicSetNeighbourWest(newNeighbourWest, msgs);
			if (msgs != null)
				msgs.dispatch();
		} else if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET,
					BoardGamePackage.FIELD__NEIGHBOUR_WEST, newNeighbourWest,
					newNeighbourWest));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Figure getFigure() {
		return figure;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetFigure(Figure newFigure,
			NotificationChain msgs) {
		Figure oldFigure = figure;
		figure = newFigure;
		if (eNotificationRequired()) {
			ENotificationImpl notification = new ENotificationImpl(this,
					Notification.SET, BoardGamePackage.FIELD__FIGURE,
					oldFigure, newFigure);
			if (msgs == null)
				msgs = notification;
			else
				msgs.add(notification);
		}
		return msgs;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setFigure(Figure newFigure) {
		if (newFigure != figure) {
			NotificationChain msgs = null;
			if (figure != null)
				msgs = ((InternalEObject) figure).eInverseRemove(this,
						BoardGamePackage.FIGURE__FIELD, Figure.class, msgs);
			if (newFigure != null)
				msgs = ((InternalEObject) newFigure).eInverseAdd(this,
						BoardGamePackage.FIGURE__FIELD, Figure.class, msgs);
			msgs = basicSetFigure(newFigure, msgs);
			if (msgs != null)
				msgs.dispatch();
		} else if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET,
					BoardGamePackage.FIELD__FIGURE, newFigure, newFigure));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public int getX() {
		return x;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setX(int newX) {
		int oldX = x;
		x = newX;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET,
					BoardGamePackage.FIELD__X, oldX, x));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public int getY() {
		return y;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setY(int newY) {
		int oldY = y;
		y = newY;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET,
					BoardGamePackage.FIELD__Y, oldY, y));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public NotificationChain eInverseAdd(InternalEObject otherEnd,
			int featureID, NotificationChain msgs) {
		switch (featureID) {
		case BoardGamePackage.FIELD__BOARD:
			if (eInternalContainer() != null)
				msgs = eBasicRemoveFromContainer(msgs);
			return basicSetBoard((Board) otherEnd, msgs);
		case BoardGamePackage.FIELD__NEIGHBOUR_NORTH:
			if (neighbourNorth != null)
				msgs = ((InternalEObject) neighbourNorth).eInverseRemove(this,
						BoardGamePackage.FIELD__NEIGHBOUR_SOUTH, Field.class,
						msgs);
			return basicSetNeighbourNorth((Field) otherEnd, msgs);
		case BoardGamePackage.FIELD__NEIGHBOUR_SOUTH:
			if (neighbourSouth != null)
				msgs = ((InternalEObject) neighbourSouth).eInverseRemove(this,
						BoardGamePackage.FIELD__NEIGHBOUR_NORTH, Field.class,
						msgs);
			return basicSetNeighbourSouth((Field) otherEnd, msgs);
		case BoardGamePackage.FIELD__NEIGHBOUR_EAST:
			if (neighbourEast != null)
				msgs = ((InternalEObject) neighbourEast).eInverseRemove(this,
						BoardGamePackage.FIELD__NEIGHBOUR_WEST, Field.class,
						msgs);
			return basicSetNeighbourEast((Field) otherEnd, msgs);
		case BoardGamePackage.FIELD__NEIGHBOUR_WEST:
			if (neighbourWest != null)
				msgs = ((InternalEObject) neighbourWest).eInverseRemove(this,
						BoardGamePackage.FIELD__NEIGHBOUR_EAST, Field.class,
						msgs);
			return basicSetNeighbourWest((Field) otherEnd, msgs);
		case BoardGamePackage.FIELD__FIGURE:
			if (figure != null)
				msgs = ((InternalEObject) figure)
						.eInverseRemove(this, EOPPOSITE_FEATURE_BASE
								- BoardGamePackage.FIELD__FIGURE, null, msgs);
			return basicSetFigure((Figure) otherEnd, msgs);
		}
		return super.eInverseAdd(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd,
			int featureID, NotificationChain msgs) {
		switch (featureID) {
		case BoardGamePackage.FIELD__BOARD:
			return basicSetBoard(null, msgs);
		case BoardGamePackage.FIELD__NEIGHBOUR_NORTH:
			return basicSetNeighbourNorth(null, msgs);
		case BoardGamePackage.FIELD__NEIGHBOUR_SOUTH:
			return basicSetNeighbourSouth(null, msgs);
		case BoardGamePackage.FIELD__NEIGHBOUR_EAST:
			return basicSetNeighbourEast(null, msgs);
		case BoardGamePackage.FIELD__NEIGHBOUR_WEST:
			return basicSetNeighbourWest(null, msgs);
		case BoardGamePackage.FIELD__FIGURE:
			return basicSetFigure(null, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public NotificationChain eBasicRemoveFromContainerFeature(
			NotificationChain msgs) {
		switch (eContainerFeatureID()) {
		case BoardGamePackage.FIELD__BOARD:
			return eInternalContainer().eInverseRemove(this,
					BoardGamePackage.BOARD__FIELDS, Board.class, msgs);
		}
		return super.eBasicRemoveFromContainerFeature(msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
		case BoardGamePackage.FIELD__BOARD:
			return getBoard();
		case BoardGamePackage.FIELD__NEIGHBOUR_NORTH:
			if (resolve)
				return getNeighbourNorth();
			return basicGetNeighbourNorth();
		case BoardGamePackage.FIELD__NEIGHBOUR_SOUTH:
			if (resolve)
				return getNeighbourSouth();
			return basicGetNeighbourSouth();
		case BoardGamePackage.FIELD__NEIGHBOUR_EAST:
			if (resolve)
				return getNeighbourEast();
			return basicGetNeighbourEast();
		case BoardGamePackage.FIELD__NEIGHBOUR_WEST:
			if (resolve)
				return getNeighbourWest();
			return basicGetNeighbourWest();
		case BoardGamePackage.FIELD__FIGURE:
			return getFigure();
		case BoardGamePackage.FIELD__X:
			return getX();
		case BoardGamePackage.FIELD__Y:
			return getY();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
		case BoardGamePackage.FIELD__BOARD:
			setBoard((Board) newValue);
			return;
		case BoardGamePackage.FIELD__NEIGHBOUR_NORTH:
			setNeighbourNorth((Field) newValue);
			return;
		case BoardGamePackage.FIELD__NEIGHBOUR_SOUTH:
			setNeighbourSouth((Field) newValue);
			return;
		case BoardGamePackage.FIELD__NEIGHBOUR_EAST:
			setNeighbourEast((Field) newValue);
			return;
		case BoardGamePackage.FIELD__NEIGHBOUR_WEST:
			setNeighbourWest((Field) newValue);
			return;
		case BoardGamePackage.FIELD__FIGURE:
			setFigure((Figure) newValue);
			return;
		case BoardGamePackage.FIELD__X:
			setX((Integer) newValue);
			return;
		case BoardGamePackage.FIELD__Y:
			setY((Integer) newValue);
			return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
		case BoardGamePackage.FIELD__BOARD:
			setBoard((Board) null);
			return;
		case BoardGamePackage.FIELD__NEIGHBOUR_NORTH:
			setNeighbourNorth((Field) null);
			return;
		case BoardGamePackage.FIELD__NEIGHBOUR_SOUTH:
			setNeighbourSouth((Field) null);
			return;
		case BoardGamePackage.FIELD__NEIGHBOUR_EAST:
			setNeighbourEast((Field) null);
			return;
		case BoardGamePackage.FIELD__NEIGHBOUR_WEST:
			setNeighbourWest((Field) null);
			return;
		case BoardGamePackage.FIELD__FIGURE:
			setFigure((Figure) null);
			return;
		case BoardGamePackage.FIELD__X:
			setX(X_EDEFAULT);
			return;
		case BoardGamePackage.FIELD__Y:
			setY(Y_EDEFAULT);
			return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
		case BoardGamePackage.FIELD__BOARD:
			return getBoard() != null;
		case BoardGamePackage.FIELD__NEIGHBOUR_NORTH:
			return neighbourNorth != null;
		case BoardGamePackage.FIELD__NEIGHBOUR_SOUTH:
			return neighbourSouth != null;
		case BoardGamePackage.FIELD__NEIGHBOUR_EAST:
			return neighbourEast != null;
		case BoardGamePackage.FIELD__NEIGHBOUR_WEST:
			return neighbourWest != null;
		case BoardGamePackage.FIELD__FIGURE:
			return figure != null;
		case BoardGamePackage.FIELD__X:
			return x != X_EDEFAULT;
		case BoardGamePackage.FIELD__Y:
			return y != Y_EDEFAULT;
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy())
			return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (x: ");
		result.append(x);
		result.append(", y: ");
		result.append(y);
		result.append(')');
		return result.toString();
	}

} //FieldImpl
